package com.neutech.maplestory.util;

import java.awt.*;
import java.util.HashMap;
import java.util.Map;

/**
 * 静态加载项目中所有图片资源
 * @author ZZQ
 * @PackageName: com.neutech.maplestory.util
 * @ClassName: ImageUtil
 * @Description:
 * @date 2021/1/27 16:41
 */
public class ImageUtil {
    private static Map<String, Image> imageMap = new HashMap<>();
    static {
        //LOGO
        imageMap.put("logo",GameUtil.getImage("icon/logo"));
        //hero right stand
        for (int i = 0;i < 4;i ++){
            imageMap.put("hero_right_stand" + i,GameUtil.getImage("hero/right/stand/stand1_" + i));
        }
        //hero left stand
        for (int i = 0;i < 4;i ++){
            imageMap.put("hero_left_stand" + i,GameUtil.getImage("hero/left/stand/stand1_" + i));
        }
        //hero right walk
        for (int i = 0;i < 5;i ++){
            imageMap.put("hero_right_walk" + i,GameUtil.getImage("hero/right/walk/walk1_" + i));
        }
        //hero left walk
        for (int i = 0;i < 5;i ++){
            imageMap.put("hero_left_walk" + i,GameUtil.getImage("hero/left/walk/walk1_" + i));
        }
        //hero left right prone
        imageMap.put("hero_right_prone",GameUtil.getImage("hero/right/prone/proneStab_0"));
        imageMap.put("hero_left_prone",GameUtil.getImage("hero/left/prone/prone_0"));
        //hero left right jump
        imageMap.put("hero_right_jump",GameUtil.getImage("hero/right/jump/jump_0"));
        imageMap.put("hero_left_jump",GameUtil.getImage("hero/left/jump/jump_0"));
        //hero right shoot
        for (int i = 0;i < 4;i ++){
            imageMap.put("hero_right_shoot" + i,GameUtil.getImage("hero/right/shoot/shoot1_" + i));
        }
        //hero left shoot
        for (int i = 0;i < 4;i ++){
            imageMap.put("hero_left_shoot" + i,GameUtil.getImage("hero/left/shoot/shoot1_" + i));
        }
        //hero left right arrow
        imageMap.put("hero_right_arrow",GameUtil.getImage("arrow/right/hero_arrow"));
        imageMap.put("hero_left_arrow",GameUtil.getImage("arrow/left/hero_arrow"));
        //mob left stand
        for (int i = 0; i < 6; i++) {
            imageMap.put("mob01_left_stand" + i,GameUtil.getImage("mob/mob01/left/stand/stand_" + i));
        }
        //mob left walk
        for (int i = 0; i < 6; i++) {
            imageMap.put("mob01_left_walk" + i,GameUtil.getImage("mob/mob01/left/walk/move_" + i));
        }
        for (int i = 0; i < 7; i++) {
            imageMap.put("mob01_left_die" + i,GameUtil.getImage("mob/mob01/left/die/die1_" + i));
        }
        //普通小怪的血块
        imageMap.put("blood",GameUtil.getImage("blood/blood"));
        //道具
        imageMap.put("HP_50",GameUtil.getImage("item/HP_50"));
        imageMap.put("HP_100",GameUtil.getImage("item/HP_100"));
        imageMap.put("HP_300",GameUtil.getImage("item/HP_300"));
        imageMap.put("MP_100",GameUtil.getImage("item/MP_100"));
        //道具包
        imageMap.put("itemPackage",GameUtil.getImage("itempackage/ItemPackage"));
        //伤害值图片组
        for(int i = 0;i < 10;i ++){
            imageMap.put("power" + i,GameUtil.getImage("power/" + i));
        }
        //怪物的右站立 mob right stand
        for(int i = 0;i < 6;i ++){
            imageMap.put("mob01_right_stand" + i,GameUtil.getImage("mob/mob01/right/stand/stand_" + i));
        }
        //怪物的右移动 mob right walk
        for(int i = 0;i < 6;i ++){
            imageMap.put("mob01_right_walk" + i,GameUtil.getImage("mob/mob01/right/walk/move_" + i));
        }
        //怪物的朝右死亡状态 mob right die
        for(int i = 0;i < 6;i ++){
            imageMap.put("mob01_right_die" + i,GameUtil.getImage("mob/mob01/right/die/die1_" + i));
        }
//        for(int i = 0;i < 100;i ++)
//        imageMap.put("ground1" + i,GameUtil.getImage("ground1"));
        //导入背景
        imageMap.put("ground4",GameUtil.getImage("ground/ground4"));

        imageMap.put("blood01",GameUtil.getImage("blood/blood01"));

        imageMap.put("boold2",GameUtil.getImage("blood/boold2"));
   }
    private ImageUtil(){}

    /**
     * 通过图片对象的key获取图片对象
     * @param key 键
     * @return 图片对象
     */
    public static Image getImage(String key){
        return imageMap.get(key);
    }

}


